package com.woniu.carrent.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

import com.woniu.carrent.pojo.TUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TUserMapper extends BaseMapper<TUser> {
    @Select("select * from t_user where userId=#{userId}")
    @Results({
            @Result(id = true, property = "userid", column = "userId"),
            @Result(property = "username", column = "userName"),
            @Result(property = "utypeid", column = "uTypeId"),
            @Result(property = "phone", column = "phone"),
            @Result(property = "email", column = "email"),
            @Result(property = "status", column = "status"),
            @Result(property = "info", column = "info"),
            @Result(property = "tUserinfo", column = "info",
                    one = @One(select = "com.woniu.carrent.mapper.TUserinfoMapper.selectByInfoId")),
    })
    TUser selectByUserId(Integer userId);
}
